package com.finger.hospservice.controller.api;

import com.finger.commonutil.exception.YyghException;
import com.finger.hospservice.service.HospSetService;
import com.finger.hospservice.service.ScheduleService;
import com.finger.modelservice.model.hosp.Schedule;
import com.finger.modelservice.result.Result;
import com.finger.modelservice.result.ResultCodeEnum;
import com.finger.modelservice.vo.hosp.ScheduleOrderVo;
import com.finger.modelservice.vo.order.OrderMqVo;
import com.finger.modelservice.vo.order.SignInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

/**
 * 内部接口,供其他模块使用
 */
@RestController
@RequestMapping("site/hospital/api")
public class HospitalApiController {

    @Autowired
    private ScheduleService scheduleService;

    @GetMapping("inner/findScheduleOrderVO/{scheduleId}")
    public ScheduleOrderVo findScheduleOrderVO(@PathVariable String scheduleId){

        return scheduleService.findScheduleOrderVO(scheduleId);
    }

    @PutMapping("inner/updateSchedule")
    public Result updateSchedule(@RequestBody OrderMqVo orderMqVo){

        if(orderMqVo == null ) throw new YyghException(ResultCodeEnum.PARAM_ERROR);

        scheduleService.updateSchedule(orderMqVo);

        return Result.ok();
    }


}
